package com.tianqu.tms.www.car.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.tianqu.tms.core.base.Logger;
import com.tianqu.tms.core.base.TmsAction;
import com.tianqu.tms.core.base.UserContext;
import com.tianqu.tms.core.util.TmsConstants;
import com.tianqu.tms.www.car.controller.CarImportExportMonitoringGateListCotroller;
import com.tianqu.tms.www.car.viewhelper.CarImportExportGateViewHelper;

/**
 * 进出口监控页
 *
 */
public class CarImportExportMonitoringGateListAction extends TmsAction {
	
	private Logger logger = Logger.getLogger(CarImportExportMonitoringGateListAction.class);


	@SuppressWarnings("unchecked")
	@Override
	protected ActionForward doAction(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response,
			UserContext uc) throws Exception {
		logger.debug(this.getClass().getName() + "#execute was called.");
		
		uc.setAttribute("updateFlag", request.getParameter("updateFlag"));
		uc.setAttribute("gateId", request.getParameter("gateId"));
		uc.setAttribute("gateId1", request.getParameter("gateId1"));
		uc.setAttribute("gateId2", request.getParameter("gateId2"));
		
		CarImportExportMonitoringGateListCotroller controller = new CarImportExportMonitoringGateListCotroller();
		controller.execute(uc);
		
		CarImportExportGateViewHelper view = (CarImportExportGateViewHelper)uc.getAttribute(TmsConstants.VIEWHELP);

		uc.setAttribute(TmsConstants.VIEWHELP, view);
		request.setAttribute(TmsConstants.VIEWHELP, view);		
		logger.debug(this.getClass().getName() + "#execute was completed.");
		return mapping.findForward(TmsConstants.SUCCESS);
	}
}
